/*
 * @Author: 秦弘林 1092750452@qq.com
 * @Date: 2023-04-08 09:25:13
 * @LastEditors: 秦弘林 1092750452@qq.com
 * @LastEditTime: 2023-06-27 14:22:37
 * @FilePath: \wms-middle-console---front\src\hooks\useGlobal.ts
 */
import { getCurrentInstance } from 'vue'

import { useStore } from 'vuex'
import { useRoute, useRouter } from 'vue-router'

/**
 * @method  导出全局公用对象
 */
export default function useGlobal() {
  /**当前组件实例 */
  const { proxy } = getCurrentInstance()

  /**store */
  const store = useStore()

  /**全局路由对象 */
  const router = useRouter()

  /**当前路由对象 */
  const route = useRoute()

  return {
    proxy,
    store,
    route,
    router,
  }
}
